using Furion.DatabaseAccessor;

using Microsoft.EntityFrameworkCore;

using System;
using System.ComponentModel.DataAnnotations.Schema;

using Tool;

namespace Abc.Core.Entities
{
    /// <summary>
    /// 角色权限/角色功能
    /// </summary>
    [TablePrefix("Web.")]
    [Comment("角色权限/角色功能")]
    public class RolePermission : IEntity, ICreate
    {
        /// <summary>
        /// 创建用户ID
        /// </summary>
        [Comment("创建用户ID")]
        public int? CreatorUserId { get; set; }

        /// <summary>
        /// 创建用户
        /// </summary>
        [Comment("创建用户")]
        public string CreatorUserName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Comment("创建时间")]
        public DateTimeOffset CreationTime { get; set; } = DateTimeOffset.Now;

        /// <summary>
        /// 角色Id
        /// </summary>
        [Comment("角色Id")]
        public int RoleId { get; set; }

        public Role Role { get; set; }

        /// <summary>
        /// 功能/权限Id
        /// </summary>
        [Comment("功能/权限Id")]
        public int PermissionId { get; set; }

        public Permission Permission { get; set; }
    }
}